<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
    <link rel="icon" th:href="@{https://v3.bootcss.com/favicon.ico}">
    <title>使用者</title>
    <link rel="stylesheet" th:href="@{/css/dashboard.css}">
    <link rel="stylesheet" th:href="@{/css/bootstrap.min.css}">
    <link rel="stylesheet" th:href="@{/css/dashboard.css}">
</head>
<body>
<div th:insert="~{commons/commons::topbar}"></div>
<div class="container-fluid">
    <div class="row">

        <div th:insert="~{commons/commons::sidebar(active = 'user.html')}"></div>


        <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
            <h1 class="page-header">用户列表</h1>
            <div class="row placeholders"></div>
            <h2 class="sub-header">
                <a class="btn btn-sm btn-success" th:href="@{/user}">新增用户</a>

            </h2>
            <div class="table-responsive">
                <table class="table table-striped">
                    <thead>
                    <!-- 表头 -->
                    <tr>
                        <th>编号</th>
                        <th>姓名</th>
                        <th>邮箱</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <!-- 身体   遍历取值 -->
                    <tr th:each="user : ${users}">
                        <td th:text="${user.id}"></td>
                        <td th:text="${user.lastName}"></td>
                        <td th:text="${user.email}"></td>

                        <td><a class="btn btn-sm btn-primary"
                               th:href="@{/user/} + ${user.id}">编辑</a> <a
                                class="btn btn-sm btn-danger"
                                th:href="@{/deleteUserById/} + ${user.id}">删除</a></td>

                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>

</body>
</html>